package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.DepEmpInfoDTO;
import org.jsola.hr.dto.DepInfoAddDTO;
import org.jsola.hr.dto.DepInfoUpdateDTO;
import org.jsola.hr.query.DepAndInfoQuery;
import org.jsola.hr.query.DepEmpNameQuery;
import org.jsola.hr.query.DepInfoQuery;
import org.jsola.hr.vo.DepInfoListVO;
import org.jsola.hr.vo.DepInfoVO;

import java.util.List;

/**
 * @author zhr
 */
@Api(tags = "hr-部门信息")
public interface IDepInfoControllerAPI {

    /**
     * 新增部门信息
     *
     * @param depInfoAddDTO 部门信息新增实体
     * @return 部门信息展示对象
     */
    @ApiOperation(value = "新增部门信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoAddDTO", dataType = "DepInfoAddDTO", value = "新增部门信息", paramType = "body")
    })
    Result<DepInfoVO> save(DepInfoAddDTO depInfoAddDTO);


    /**
     * 修改部门信息
     *
     * @param depInfoUpdateDTO 部门信息
     * @return 更新数量
     */
    @ApiOperation(value = "修改部门信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoUpdateDTO", dataType = "DepInfoUpdateDTO", value = "修改部门信息", paramType = "body")
    })
    Result<Integer> update(DepInfoUpdateDTO depInfoUpdateDTO);


    /**
     * 删除单个部门信息，彻底删除
     *
     * @param depInfoId 部门信息id
     * @return 删除数量
     */
    @ApiOperation(value = "删除单个部门信息，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoId", dataType = "String", value = "部门信息id", paramType = "path")
    })
    Result<Integer> delete(String depInfoId);


    /**
     * 批量删除部门信息，彻底删除
     *
     * @param depInfoIds 部门信息id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除部门信息，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoIds", dataType = "String[]", value = "部门信息id数组", paramType = "body", allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] depInfoIds);


    /**
     * 根据部门信息id查询部门信息详情
     *
     * @param depInfoId 部门信息id
     * @return 部门信息详情
     */
    @ApiOperation(value = "根据部门信息id查询部门信息详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoId", dataType = "String", value = "部门信息id", paramType = "path"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "query")
    })
    Result<DepInfoVO> findById(String depInfoId, String companyId);


    /**
     * 查询部门信息
     *
     * @param depInfoQuery 部门信息查询参数
     * @return page
     */
    @ApiOperation(value = "查询部门信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoQuery", dataType = "DepInfoQuery", value = "部门信息查询参数", paramType = "query")
    })
    Result<List<DepInfoListVO>> listAll(DepInfoQuery depInfoQuery);


    /**
     * 分页查询部门信息
     *
     * @param depInfoQuery 部门信息查询参数
     * @return page
     */
    @ApiOperation(value = "分页查询部门信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoQuery", dataType = "DepInfoQuery", value = "部门信息查询参数", paramType = "query")
    })
    Result<Page<DepInfoListVO>> page(DepInfoQuery depInfoQuery);

    /**
     * 查询部门树形列表
     *
     * @param depInfoQuery 部门信息查询参数
     * @return List<DepInfoListVO>
     */
    @ApiOperation(value = "查询部门树形列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoQuery", dataType = "DepInfoQuery", value = "部门信息查询参数", paramType = "query")
    })
    Result<List<DepInfoListVO>> listTree(DepInfoQuery depInfoQuery);

    /**
     * 查询公司下部门及部门成员
     *
     * @param depAndInfoQuery 部门信息查询参数
     * @return List<DepInfoListVO>
     */
    @ApiOperation(value = "查询公司下部门及部门成员(新组织架构接口,不包含公司级部门,最顶级是公司下部门)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "depAndInfoQuery", dataType = "DepAndInfoQuery", value = "部门及员工信息查询参数", paramType = "query")
    })
    Result<List<DepInfoListVO>> getDepAndEmpInfo(String companyId, DepAndInfoQuery depAndInfoQuery);

    /**
     * 查询公司下部门及部门成员
     *
     * @param depAndInfoQuery 部门信息查询参数
     * @return List<DepInfoListVO>
     */
    @ApiOperation(value = "查询公司下部门及部门成员(新组织架构接口,不包含公司级部门,最顶级是公司下部门，可传员工状态，在职或离职)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "depAndInfoQuery", dataType = "DepAndInfoQuery", value = "部门及员工信息查询参数", paramType = "query")
    })
    Result<List<DepInfoListVO>> selectDepAndEmpInfo(String companyId, DepAndInfoQuery depAndInfoQuery);

    /**
     * 查询公司下部门及部门成员
     *
     * @param depAndInfoQuery 部门信息查询参数
     * @return List<DepInfoListVO>
     */
    @ApiOperation(value = "查询公司下部门及部门成员(新组织架构接口,最顶级是公司级部门)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "path"),
            @ApiImplicitParam(name = "depAndInfoQuery", dataType = "DepAndInfoQuery", value = "部门及员工信息查询参数", paramType = "query")
    })
    Result<DepInfoListVO> getCompanyDepEmp(String companyId, DepAndInfoQuery depAndInfoQuery);

    /**
     * 查询部门树
     *
     * @param companyId 公司Id
     * @param depName   部门Id
     * @return 部门树
     */
    @ApiOperation(value = "查询部门树")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司Id", paramType = "query"),
            @ApiImplicitParam(name = "depName", dataType = "String", value = "部门名称", paramType = "query")
    })
    Result<List<DepInfoVO>> selectDepTree(String companyId, String depName);

    /**
     * 部门管理页面,选择某个部门
     *
     * @param depInfoQuery 查询参数
     * @return 部门管理
     */
    @ApiOperation(value="部门管理页面,选择某个部门")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "depInfoQuery", dataType = "DepInfoQuery", value = "查询参数", paramType = "query")
    })
    Result<Page<DepInfoVO>> depManageByDepId(DepInfoQuery depInfoQuery);
}

